package com.agile.leetcode.tomcat.netty;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpRequest;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/8/9 18:08
 */
public class NettyRequest {
    private ChannelHandlerContext ctx;
    private HttpRequest httpRequest;

    public NettyRequest(ChannelHandlerContext ctx, HttpRequest httpRequest) {
        this.ctx = ctx;
        this.httpRequest = httpRequest;
    }
    public String getUrl() {
        return httpRequest.uri();
    }

    public String getMethod() {
        return httpRequest.method().name();
    }
}
